<div class="layuimini-main">

    <div class="layui-form layuimini-form">
        <div class="layui-form-item">
            <label class="layui-form-label required">星期</label>
            <div class="layui-input-block">
                <input type="text" name="wdayday" lay-verify="required" lay-reqtext="星期不能为空" placeholder="请输入星期几" value="" class="layui-input">
                <tip>填写星期</tip>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label required">人员</label>
            <div class="layui-input-block">
                <input type="text" name="worker" lay-verify="required" lay-reqtext="人员不能为空" placeholder="请填写人员名称" value="" class="layui-input">
                <tip>填写人员名称</tip>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label required">电话</label>
            <div class="layui-input-block">
                <input type="text" name="phone" lay-verify="required" lay-reqtext="电话不能为空" placeholder="请填电话号码" value="" class="layui-input">
                <tip>填写电话号码</tip>
            </div>
        </div>

        <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn layui-btn-normal" lay-submit lay-filter="saveBtn">确认保存</button>
            </div>
        </div>
    </div>
</div>
<script>
    layui.use(['form', 'table'], function () {
        var form = layui.form,
            layer = layui.layer,
            table = layui.table,
            $ = layui.$;

        /**
         * 初始化表单，要加上，不然刷新部分组件可能会不加载
         */
        form.render();

        // 当前弹出层，防止ID被覆盖
        var parentIndex = layer.index;

        //监听提交
        form.on('submit(saveBtn)', function (data) {
            //获取表单中的数据信息
            var datas=data.field;
            addOrUpdateSubmit($,"roster/add",datas);
            return false;
        });

    });
</script>